package models

import (
	"time"
)

// RepairStatus 维修状态
type RepairStatus string

const (
	StatusPending    RepairStatus = "待处理"
	StatusProcessing RepairStatus = "处理中"
	StatusCompleted  RepairStatus = "已完成"
	StatusRejected   RepairStatus = "已驳回"
)

// RepairRequest 维修申请模型
type RepairRequest struct {
	ID          uint         `gorm:"primarykey" json:"id"`
	RoomNo      string       `gorm:"size:20;not null" json:"room_no"`
	StudentID   string       `gorm:"size:20;not null" json:"student_id"`
	StudentName string       `gorm:"size:50;not null" json:"student_name"`
	Type        string       `gorm:"size:50;not null" json:"type"` // 维修类型：水电维修、家具维修等
	Description string       `gorm:"size:500;not null" json:"description"`
	Status      RepairStatus `gorm:"size:20;not null;default:'待处理'" json:"status"`
	Comment     string       `gorm:"size:500" json:"comment"` // 处理意见
	CreatedAt   time.Time    `json:"created_at"`
	UpdatedAt   time.Time    `json:"updated_at"`
	ProcessedAt *time.Time   `json:"processed_at"` // 处理时间
}
